<template>
  <view class="my p-48">
    <view class="my-logo flex-left-center">
      <nut-avatar class="m-r-10 avatar"> <img :src="url" /> </nut-avatar>
      <view class="avatar-content flex-between-center p-l-10">
        <view>
          <view class="welcome fs-28 m-b-5">欢迎</view>
          <view class="name fs-34 f-bold">管理员</view>
        </view>

        <view class="login-out">
          <IconFont size="16" font-class-name="iconfont" class-prefix="icon" name="fi-rr-sign-out"> </IconFont>
        </view>

      </view>
    </view>
    <view class="my-setting animate__animated animate__fadeInUp">
      <view v-for="i in 5" :key="i"
        :class="{ 'my-setting-item': true, 'flex-between-center': true, 'press-bg-color': active === i }"
        @touchstart="settingDown(i)" @touchend="settingUp">
        <view class="my-setting-item_icon flex-center">
          <IconFont color="#316D86" size="16" font-class-name="iconfont" class-prefix="icon" name="fi-rr-sign-out">
          </IconFont>
        </view>
        <view class="my-setting-item_info flex-between-center">
          <text class="f-bold fs-30">
            嘿嘿嘿
          </text>
          <text>
            <IconFont size="16" name="rect-right" class="color-base3"> </IconFont>
          </text>
        </view>
      </view>
    </view>
  </view>
</template>
<script setup name="My">
definePageConfig({
  navigationBarTitleText: '我的'
})
import Taro from '@tarojs/taro'
import { IconFont } from '@nutui/icons-vue-taro';
import { ref } from 'vue'

const url = 'https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png';

const active = ref(null)

function settingDown(i) {
  active.value = i
}
function settingUp() {
  active.value = null
}

</script>
<style lang="scss">
.color-base3 {
  color: $color-base3;
}

.press-bg-color {
  background-color: $color-bg !important;
}

.my {
  position: relative;
}

.my-logo {
  height: 140px;
  border-top: 1px solid #F1F5F9;
  border-bottom: 1px solid #F1F5F9;
}

.avatar {
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 5px 12px 0 rgba(0, 0, 0, .3)
}

.avatar-content {
  flex: 1;
}

.welcome {
  color: #64748B;
}

.name {
  color: $color-base;
}

.login-out {
  background-color: #F1F5F9;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: $color-base3;
  width: 70px;
  height: 70px;
}

.my-setting {
  padding-top: 60px;

  .my-setting-item {

    padding: 16px 0;
  }

  .my-setting-item_icon {
    width: 80px;
    height: 80px;
    background-color: #DCF0F9;
    border-radius: 50%;
    margin-right: 28px;
  }

  .my-setting-item_info {
    flex: 1;
  }
}
</style>